<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    <input type="text" placeholder="输入密码">
    <script>   
        var text = document.querySelector('input');
        text.onfocus = function() {
                text.placeholder='';
        }

        text.onblur = function() {
            if(text.placeholder==='') {
                this.placeholder='手机'
            }
        }
    </script>
</body>
</html>